/*
 * Copyright (c) United Binary LLC.  All rights reserved.
 * 
 * This code is licensed under the MIT License
 * 
 * SEE: http://harnessit.codeplex.com/license
 * 
 */
using System;
using System.Threading;

using UnitedBinary.UnitTests.Framework;

namespace TestingTestClasses
{
	public class MultipleExceptionTest
	{
		public MultipleExceptionTest()
		{
		}

		// No good in .NET 2.0 and above.
		//[TestMethod]
		//public void ThreeExceptions(TestMethodRecord tmr)
		//{
		//    ThreadStart start = new ThreadStart(ExceptionThreadProc);
		//    Thread exceptionThread1 = new Thread(start);
		//    exceptionThread1.Name = "First Exception Thread";
		//    Thread exceptionThread2 = new Thread(start);
		//    exceptionThread2.Name = "Second Exception Thread";
		//    Thread exceptionThread3 = new Thread(start);
		//    exceptionThread3.Name = "Third Exception Thread";

		//    tmr.RegisterException("Testing multi-threaded exception handling.");

		//    exceptionThread1.Start();
		//    exceptionThread2.Start();
		//    exceptionThread3.Start();

		//    if (exceptionThread1.IsAlive)
		//    {
		//        exceptionThread1.Join();
		//    }

		//    if (exceptionThread2.IsAlive)
		//    {
		//        exceptionThread2.Join();
		//    }

		//    if (exceptionThread3.IsAlive)
		//    {
		//        exceptionThread3.Join();
		//    }
		//}

		//private void ExceptionThreadProc()
		//{
		//	Random rnd = new Random();
		//	Thread.Sleep(rnd.Next(50, 250));

		//	throw new Exception("Exception thread's exception.");
		//}
	}
}
